package com.wzy.web.pojo;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import org.hibernate.annotations.GenericGenerator;

/**
 * PmLeader entity.
 * 
 * @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "pm_leader", catalog = "saozhe")
public class PmLeader implements java.io.Serializable {

	// Fields

	private Integer leaderId;
	private PmUser pmUser;
	private PmProject pmProject;

	// Constructors

	/** default constructor */
	public PmLeader() {
	}

	/** full constructor */
	public PmLeader(PmUser pmUser, PmProject pmProject) {
		this.pmUser = pmUser;
		this.pmProject = pmProject;
	}

	// Property accessors
	@GenericGenerator(name = "generator", strategy = "increment")
	@Id
	@GeneratedValue(generator = "generator")
	@Column(name = "leaderId", unique = true, nullable = false)
	public Integer getLeaderId() {
		return this.leaderId;
	}

	public void setLeaderId(Integer leaderId) {
		this.leaderId = leaderId;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "userId", nullable = false)
	public PmUser getPmUser() {
		return this.pmUser;
	}

	public void setPmUser(PmUser pmUser) {
		this.pmUser = pmUser;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "projectId", nullable = false)
	public PmProject getPmProject() {
		return this.pmProject;
	}

	public void setPmProject(PmProject pmProject) {
		this.pmProject = pmProject;
	}

}